/**
 * @Description:
 * @Author bianpengfei
 * @create 2021/6/25 9:14
 */
const reducer = (previousState = {}, action) => {
  console.log('打印', previousState, action)
  const result = JSON.parse(JSON.stringify(previousState))
  switch (action.type) {
    case 'increment':
      result.count = action.payload
      break
    case 'subtract':
      result.count = action.payload
      break
  }
  return result
}

export default reducer
